Preconditions
Simple static methods to be called at the start of your own methods to verify correct arguments and state.
Functions
Link copied to clipboard
Ensures that the argument floating point value is a finite number.
Link copied to clipboard
open fun checkArgumentInRange(value: Double, lower: Double, upper: Double, @NonNull valueName: String): Double
Ensures that the argument double value is within the inclusive range.
open fun checkArgumentInRange(value: Float, lower: Float, upper: Float, @NonNull valueName: String): Float
Ensures that the argument float value is within the inclusive range.
Ensures that the argument int value is within the inclusive range.
open fun checkArgumentInRange(value: Long, lower: Long, upper: Long, @NonNull valueName: String): Long
Ensures that the argument long value is within the inclusive range.
Link copied to clipboard
Ensures that that the argument numeric value is non-negative.
Link copied to clipboard
Check the requested flags, throwing if any requested flags are outside the allowed set.
Link copied to clipboard
Link copied to clipboard
Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.
Link copied to clipboard
open fun <T : CharSequence?> checkStringNotEmpty(@Nullable string: T, @NonNull errorMessage: Any): T
open fun <T : CharSequence?> checkStringNotEmpty(@Nullable string: T, @NonNull messageTemplate: String, @NonNull messageArgs: Array<Any>): T
Ensures that an string reference passed as a parameter to the calling method is not empty.